package com.tdkj.service.information.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.tdkj.dao.information.IBeanBaseInfoDao;
import com.tdkj.model.information.BeanBaseInfo;
import com.tdkj.service.BaseService;
import com.tdkj.service.information.IBeanMineService;
@Component("mineService")
public class BeanMineImpl extends BaseService implements IBeanMineService{
	private IBeanBaseInfoDao baseInfoDao;

	public IBeanBaseInfoDao getBaseInfoDao() {
		return baseInfoDao;
	}

	@Resource
	public void setBaseInfoDao(IBeanBaseInfoDao baseInfoDao) {
		this.baseInfoDao = baseInfoDao;
	}

	@Override
	public void deleteMine(Long id) {
		// TODO Auto-generated method stub
		BeanBaseInfo bean=baseInfoDao.findById(id, BeanBaseInfo.class);
		baseInfoDao.delete(bean);
	}

	@Override
	public List<BeanBaseInfo> findMines(String type) {
		// TODO Auto-generated method stub
		BeanBaseInfo bean=new BeanBaseInfo();
		bean.setModuletype(type);
		return baseInfoDao.findByExample(bean);
	}

	@Override
	public BeanBaseInfo findMine(Long id) {
		return baseInfoDao.findById(id, BeanBaseInfo.class);
	}

	@Override
	public void updateStatus(Long id) {
		// TODO Auto-generated method stub
		BeanBaseInfo bean=baseInfoDao.findById(id, BeanBaseInfo.class);
		bean.setStatus("已审核");
		baseInfoDao.merge(bean);
	}

	
}
